var t = getApp(), e = require("../../../component/WxNotificationCenter/WxNotificationCenter.js");

Page({
    data: {
        pricesArray: []
    },
    onLoad: function(t) {
        this.setData({
            pricesArray: JSON.parse(t.data)
        }), wx.showModal({
            title: "提示",
            content: "价格仅作为自动抢单和手动抢单时匹配使用，不对外公开。",
            showCancel: !1
        });
    },
    inputCooperate: function(t) {
        var e = t.currentTarget.dataset.index, a = this.data.pricesArray;
        a[e].cooperationPrice = t.detail.value, this.setData({
            pricesArray: a
        });
        var i = getCurrentPages();
        i[i.length - 2].setData({
            pricesArray: a
        });
    },
    inputMarket: function(t) {
        var e = t.currentTarget.dataset.index, a = this.data.pricesArray;
        a[e].marketPrice = t.detail.value, this.setData({
            pricesArray: a
        });
        var i = getCurrentPages();
        i[i.length - 2].setData({
            pricesArray: a
        });
    },
    clickConfirm: function(t) {
        this.commitData();
    },
    commitData: function() {
        var a = JSON.stringify(this.data.pricesArray);
        t.network.post({
            url: t.url.SubmitWeddingOrderUserPriceList,
            params: {
                prices: a
            },
            before: function() {
                wx.showLoading({
                    title: "正在提交"
                });
            },
            success: function(a) {
                wx.hideLoading(), e.postNotificationName("didChangeCityPrice"), t.util.showToast(a.data.message), 
                1 == a.data.result && setTimeout(function() {
                    wx.navigateBack({
                        delta: 2
                    });
                }, 1e3);
            },
            fail: function() {
                wx.hideLoading(), t.util.showToast("修改失败");
            },
            complete: function() {}
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});